package zy.test.sqlite;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

public class UserUtil {

	private DBHelper3 dbHelper;
	public UserUtil(Context context) {
		dbHelper=new DBHelper3(context);
	}
	
	public void add(User user) 
	{
		
		SQLiteDatabase db=dbHelper.getWritableDatabase();
		
		db.beginTransaction();
		//db.execSQL("INSERT INTO userinfo(username,weight) VALUES('"+user.username+"',"+user.weight+")");
		db.execSQL("INSERT INTO userinfo(username,weight,password) VALUES(?,?,?)", new Object[]{user.username,user.weight,"abc"});
		db.setTransactionSuccessful();
		db.endTransaction();
		db.close();
	}
}
